// 付款计划
<template>
  <div>
    <div class="padding-bottom-10 flex justify-between">
      <span class="font-weight-700 font-size-18">付款计划</span>
      <span>合同总金额：{{ allMoney | moneyFilterNoUnit }}元</span>
    </div>
    <el-table :border="false" :data="tableList" class="new-table-style">
      <el-table-column align="left" label="事项" prop="chargeItemName"> </el-table-column>
      <el-table-column align="left" label="金额">
        <template slot-scope="scope">
          <span>{{ scope.row.fundsAmount | moneyFilterNoUnit }}</span>
        </template>
      </el-table-column>
      <el-table-column align="left" label="事项说明" prop="fundsDesc"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    props: {
      tableList: {
        type: Array,
        default: () => {
          return [];
        },
      },
    },
    computed: {
      allMoney() {
        if (this.tableList) {
          let sum = this.tableList.reduce((prev, item) => {
            prev += item.fundsAmount
            return prev;
          }, 0);

          return sum;
        }
        
        return 0;
      },
    },
    data() {
      return {
        contractType: this.$route.query.contractType,
      };
    },

    mounted() {},

    methods: {},
  };
</script>

<style lang="scss" scoped></style>
